package biz.obake.team.touchprotector.ui;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import androidx.preference.Preference;
import biz.obake.team.touchprotector.R;
import biz.obake.team.touchprotector.g.c;
import biz.obake.team.touchprotector.log.a;
import biz.obake.team.touchprotector.tpservice.TPService;
import java.text.SimpleDateFormat;

public class Tab_About extends a {
    private String loadLogs() {
        a.C0081a[] c2 = a.b().c();
        StringBuilder sb = new StringBuilder();
        if (c2.length > 0) {
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss");
            for (a.C0081a aVar : c2) {
                sb.append(String.format("%s %s\n", new Object[]{simpleDateFormat.format(aVar.f1760a), aVar.f1761b}));
            }
        }
        return sb.toString();
    }

    private void setupYouTubePref() {
    }

    private void updateVersionSummary() {
        String c2 = c.c("InAppUpdate.State");
        getPreferenceScreen().H0("version").u0(((c2.hashCode() == -525403168 && c2.equals("UpdateAvailable")) ? (char) 0 : 65535) != 0 ? R.string.pref_version_summary : R.string.pref_version_summary_update);
    }

    public void onCreatePreferences(Bundle bundle, String str) {
        setPreferencesFromResource(R.xml.ui_tab_about, str);
        Preference H0 = getPreferenceScreen().H0("version");
        H0.y0(H0.B().toString().replace("{0}", biz.obake.team.touchprotector.c.m()));
        updateVersionSummary();
        setupYouTubePref();
        prefRemove("inquiry");
        getPreferenceScreen().H0("share").s0(new Preference.e() {
            public boolean onPreferenceClick(Preference preference) {
                Intent intent = new Intent("android.intent.action.SEND");
                intent.setType("message/rfc822");
                intent.putExtra("android.intent.extra.SUBJECT", biz.obake.team.touchprotector.c.w(R.string.pref_share_email_subject));
                intent.putExtra("android.intent.extra.TEXT", biz.obake.team.touchprotector.c.w(R.string.pref_share_email_text));
                Tab_About.this.startActivity(Intent.createChooser(intent, biz.obake.team.touchprotector.c.w(R.string.pref_share_chooser)));
                return true;
            }
        });
        getPreferenceScreen().H0("exit").s0(new Preference.e() {
            public boolean onPreferenceClick(Preference preference) {
                TPService.k("Stop", "About");
                return true;
            }
        });
    }

    /* access modifiers changed from: protected */
    public void onPrefChanged(SharedPreferences sharedPreferences, String str) {
        if (((str.hashCode() == 1940503575 && str.equals("lock_screen_now")) ? (char) 0 : 65535) == 0) {
            LockScreenNowActivity.a(biz.obake.team.touchprotector.g.a.g("lock_screen_now"));
        }
    }

    /* access modifiers changed from: protected */
    public void onRamPrefChanged(String str) {
        if (((str.hashCode() == 2029748168 && str.equals("InAppUpdate.State")) ? (char) 0 : 65535) == 0) {
            updateVersionSummary();
        }
    }
}
